//
//  DZGlobleData.m
//  dzyc
//
//  Created by 蓝鳍互娱 on 2024/6/19.
//

#import "DZGlobleData.h"

@implementation DZGlobleData
static DZGlobleData *defaultManager = nil;
+(DZGlobleData*)defaultManager{
     static dispatch_once_t token;
     dispatch_once(&token, ^{
         if(defaultManager == nil){
             defaultManager = [[self alloc] init];
         }
     });
     return defaultManager;
}
+ (void)getAppBuyVip{
    DZWeakSelf
    NSDictionary *parmDic = @{@"packageName":DZBunldId};
    [[DzNetHttp defaultRequest] post:DZVipPriceUrl param:parmDic success:^(id  _Nonnull data) {
        NSDictionary * dataDic = data[@"data"];
        [DZGlobleData defaultManager].globleVipPrice = [dataDic objectForKey:@"price"];
    } fail:^(NSError * _Nonnull error) {
        [weakSelf getAppBuyVip];
    }];
}
+ (void)getAppMaiDian{
    NSMutableDictionary *parmDic = [[NSMutableDictionary alloc] init];
    [parmDic setObject:@"02:dzyc" forKey:@"name"];
    if([DZGlobleData defaultManager].globleVipPrice){
        [parmDic setObject:[DZGlobleData defaultManager].globleVipPrice forKey:@"price"];
    }
    NSString *udid = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
    [parmDic setObject:[NSString stringWithFormat:@"%@",udid] forKey:@"udid"];
    [[DzNetHttp defaultRequest] post:DZMaiDianUrl param:parmDic success:^(id  _Nonnull data) {
        
    } fail:^(NSError * _Nonnull error) {
            
    }];
}
@end
